import java.io.FileNotFoundException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2022-11-24
 * Time: 16:49
 */
class test{


}
//class Solution {
//    public int missingNumber(int[] nums) {
//        int a=nums.length;
//        int c=((1+a)*a)/2;
//        for (int i = 0; i < nums.length; i++) {
//            c-=nums[i];
//        }
//        return c;
//    }
//}
class Solution {
    public void rotate(int[] nums, int k) {
      k%=nums.length;
      int[] arr=new int[nums.length];
        for (int i =nums.length-1,a=0;a<k ; i--) {
            arr[k++]=nums[i];
        }
        for (int i = 0; i < nums.length-1-k; i++) {
            arr[k++]=nums[i];
        }
        System.arraycopy(arr, 0, nums, 0, nums.length-1);
    }
}